package com.ruoyi.season.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.appuser.domain.vo.PrizeInfo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.season.domain.PlaySeasonPrize;
import com.ruoyi.season.domain.vo.PrizeInfoVo;
import com.ruoyi.season.mapper.PlaySeasonPrizeMapper;
import com.ruoyi.season.service.IPlaySeasonPrizeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 赛季奖品Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-14
 */
@Service
public class PlaySeasonPrizeServiceImpl extends ServiceImpl<PlaySeasonPrizeMapper,PlaySeasonPrize> implements IPlaySeasonPrizeService
{
    @Autowired
    private PlaySeasonPrizeMapper playSeasonPrizeMapper;

    /**
     * 查询赛季奖品
     *
     * @param id 赛季奖品主键
     * @return 赛季奖品
     */
    @Override
    public PlaySeasonPrize selectPlaySeasonPrizeById(String id)
    {
        return playSeasonPrizeMapper.selectPlaySeasonPrizeById(id);
    }

    /**
     * 查询赛季奖品列表
     *
     * @param playSeasonPrize 赛季奖品
     * @return 赛季奖品
     */
    @Override
    public List<PlaySeasonPrize> selectPlaySeasonPrizeList(PlaySeasonPrize playSeasonPrize)
    {
        return playSeasonPrizeMapper.selectPlaySeasonPrizeList(playSeasonPrize);
    }

    /**
     * 新增赛季奖品
     *
     * @param playSeasonPrize 赛季奖品
     * @return 结果
     */
    @Override
    public int insertPlaySeasonPrize(PlaySeasonPrize playSeasonPrize)
    {
        playSeasonPrize.setCreateTime(DateUtils.getNowDate());
        return playSeasonPrizeMapper.insertPlaySeasonPrize(playSeasonPrize);
    }

    /**
     * 修改赛季奖品
     *
     * @param playSeasonPrize 赛季奖品
     * @return 结果
     */
    @Override
    public int updatePlaySeasonPrize(PlaySeasonPrize playSeasonPrize)
    {
        return playSeasonPrizeMapper.updatePlaySeasonPrize(playSeasonPrize);
    }

    /**
     * 批量删除赛季奖品
     *
     * @param ids 需要删除的赛季奖品主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonPrizeByIds(String[] ids)
    {
        return playSeasonPrizeMapper.deletePlaySeasonPrizeByIds(ids);
    }

    /**
     * 删除赛季奖品信息
     *
     * @param id 赛季奖品主键
     * @return 结果
     */
    @Override
    public int deletePlaySeasonPrizeById(String id)
    {
        return playSeasonPrizeMapper.deletePlaySeasonPrizeById(id);
    }

    @Override
    public List<PlaySeasonPrize> selectPlayCurrentPrize(String id,String playSeasonId) {
        return baseMapper.selectPlayCurrentPrize(id,playSeasonId);
    }

    @Override
    public List<PrizeInfo> selectPrizeInfo(String loginUserId,String playSeasonId,String playSeasonRecordId) {
        return baseMapper.selectPrizeInfo(loginUserId,playSeasonId,playSeasonRecordId);
    }

    /**奖品信息*/
    @Override
    public List<PrizeInfoVo> selectPrizeInfoById(IPage<PrizeInfoVo> page, String playSeasonRecordId, String playSeasonId) {
        return baseMapper.selectPrizeInfoById(page,playSeasonRecordId,playSeasonId);
    }

    @Override
    public List<PrizeInfoVo> selectNormalUserPrizeInfo(IPage<PrizeInfoVo> page, String playSeasonId) {
        return baseMapper.selectNormalUserPrizeInfo(page,playSeasonId);
    }

    @Override
    public List<PlaySeasonPrize> selectNormalUserCurrentPrize(String playSeasonId) {
        return baseMapper.selectNormalUserCurrentPrize(playSeasonId);
    }
}
